/*********************************************************************NVMH3****
/ Vertex shader for blending lightmaps
******************************************************************************/

varying float diffuse;
varying vec4  texcoord[2];

uniform vec3  LightPosition;
	
void main()
{

 texcoord[0] = gl_MultiTexCoord0;
 texcoord[1] = gl_MultiTexCoord1;
 gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; 
 
  //compute diffuse for this vertex
  vec3 normal = normalize(gl_NormalMatrix * gl_Normal);
  vec3 position = vec3(gl_ModelViewMatrix * gl_Position);
  vec3 lightVec = normalize(LightPosition - position);
  diffuse = max(dot(lightVec, normal), 0.0);
	
   if (diffuse <0.125){	
	diffuse = 0.125;}
		 
		
}
